home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / DriverFamilyMatching.a < prev    next >
Text File  |  1996-05-01  |  10KB  |  284 lines

  1. ;
  2. ;    File:        DriverFamilyMatching.a
  3. ;
  4. ;    Contains:    xxx put contents here xxx
  5. ;
  6. ;    Version:    Technology:    xxx put the technology version here xxx
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__DRIVERFAMILYMATCHING__') = 'UNDEFINED' THEN
  19. __DRIVERFAMILYMATCHING__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__NAMEREGISTRY__') = 'UNDEFINED' THEN
  25.     include 'NameRegistry.a'
  26.     ENDIF
  27.     IF &TYPE('__TEXTOBJECTS__') = 'UNDEFINED' THEN
  28.     include 'TextObjects.a'
  29.     ENDIF
  30.     IF &TYPE('__CODEFRAGMENTS__') = 'UNDEFINED' THEN
  31.     include 'CodeFragments.a'
  32.     ENDIF
  33. ;  Please refer to Devices.i for DriverDescriptor definition for Marconi 
  34.     IF FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE THEN
  35. ;
  36. ;#########################################################
  37. ; Descriptor for Drivers and NDRVs
  38. ;#########################################################
  39. ;
  40. ;  Driver Typing Information Used to Match Drivers With Devices 
  41. DriverType                RECORD 0
  42. nameInfoStr                 ds        Str31            ; offset: $0 (0)        ;  Driver Name/Info String
  43. version                     ds        NumVersion        ; offset: $20 (32)        ;  Driver Version Number
  44. sizeof                     EQU *                    ; size:   $24 (36)
  45.                         ENDR
  46. ; typedef struct DriverType *            DriverTypePtr
  47.  
  48. ;  OS Runtime Information Used to Setup and Maintain a Driver's Runtime Environment 
  49. ; typedef OptionBits                     RuntimeOptions
  50.  
  51.  
  52. kDriverIsLoadedUponDiscovery    EQU        $00000001            ; auto-load driver when discovered
  53. kDriverIsOpenedUponLoad            EQU        $00000002            ; auto-open driver when loaded
  54. kDriverIsUnderExpertControl        EQU        $00000004            ; I/O expert handles loads/opens
  55. kDriverIsConcurrent                EQU        $00000008            ; supports concurrent requests
  56. kDriverQueuesIOPB                EQU        $00000010            ; device manager doesn't queue IOPB
  57. kDriverIsLoadedAtBoot            EQU        $00000020            ; Driver is loaded at the boot time 
  58. kDriverIsForVirtualDevice        EQU        $00000040            ; Driver is for a virtual Device 
  59. DriverOSRuntime            RECORD 0
  60. driverRuntime             ds.l    1                ; offset: $0 (0)        ;  Options for OS Runtime
  61. driverName                 ds        Str31            ; offset: $4 (4)        ;  Driver's name to the OS
  62. driverDescReserved         ds.l    8                ; offset: $24 (36)        ;  Reserved area
  63. sizeof                     EQU *                    ; size:   $44 (68)
  64.                         ENDR
  65. ; typedef struct DriverOSRuntime *        DriverOSRuntimePtr
  66.  
  67. ;  OS Service Information Used To Declare What APIs a Driver Supports 
  68. ; typedef UInt32                         ServiceCount
  69.  
  70. DriverServiceInfo        RECORD 0
  71. serviceCategory             ds.l    1                ; offset: $0 (0)        ;  Service Category Name
  72. serviceType                 ds.l    1                ; offset: $4 (4)        ;  Type within Category
  73. serviceVersion             ds        NumVersion        ; offset: $8 (8)        ;  Version of service
  74. sizeof                     EQU *                    ; size:   $C (12)
  75.                         ENDR
  76. ; typedef struct DriverServiceInfo *    DriverServiceInfoPtr
  77.  
  78. DriverOSService            RECORD 0
  79. nServices                 ds.l    1                ; offset: $0 (0)        ;  Number of Services Supported
  80. service                     ds        DriverServiceInfo ; offset: $4 (4) <-- really an array of length one ;  The List of Services (at least one)
  81. sizeof                     EQU *                    ; size:   $10 (16)
  82.                         ENDR
  83. ; typedef struct DriverOSService *        DriverOSServicePtr
  84.  
  85. ;  Categories 
  86.  
  87. kServiceCategoryDisplay            EQU        'disp'                ; Display Manager
  88. kServiceCategoryOpenTransport    EQU        'otan'                ; Open Transport
  89. kServiceCategoryBlockStorage    EQU        'blok'                ; Block Storage
  90. kServiceCategoryNdrvDriver        EQU        'ndrv'                ; Generic Native Driver
  91. kServiceCategoryScsiSIM            EQU        'scsi'                ; SCSI 
  92. kServiceCategoryFileManager        EQU        'file'                ; File Manager 
  93. kServiceCategoryIDE                EQU        'ide-'                ; ide 
  94. kServiceCategoryADB                EQU        'adb-'                ; adb 
  95. kServiceCategoryPCI                EQU        'pci-'                ; pci bus 
  96.                                                             ; Nu Bus 
  97. kServiceCategoryPCMCIA            EQU        'pcmc'                ; PCMCIA 
  98. kServiceCategoryDFM                EQU        'dfm-'                ; DFM 
  99. kServiceCategoryMotherBoard        EQU        'mrbd'                ; mother Board 
  100. kServiceCategoryKeyboard        EQU        'kybd'                ; Keyboard 
  101. kServiceCategoryPointing        EQU        'poit'                ; Pointing 
  102. kServiceCategoryRTC                EQU        'rtc-'                ; RTC 
  103. kServiceCategoryNVRAM            EQU        'nram'                ; NVRAM 
  104. kServiceCategorySound            EQU        'sond'                ; Sound (1/3/96 MCS) 
  105. kServiceCategoryPowerMgt        EQU        'pgmt'                ; Power Management 
  106. kServiceCategoryGeneric            EQU        'genr'                ; Generic Service Category to receive general Events 
  107. ;  Ndrv ServiceCategory Types 
  108.  
  109. kNdrvTypeIsGeneric                EQU        'genr'                ; generic
  110. kNdrvTypeIsVideo                EQU        'vido'                ; video
  111. kNdrvTypeIsBlockStorage            EQU        'blok'                ; block storage
  112. kNdrvTypeIsNetworking            EQU        'netw'                ; networking
  113. kNdrvTypeIsSerial                EQU        'serl'                ; serial
  114. kNdrvTypeIsSound                EQU        'sond'                ; sound
  115. kNdrvTypeIsBusBridge            EQU        'brdg'
  116. ; typedef UInt32                         DriverDescVersion
  117.  
  118. ;     The Driver Description 
  119.  
  120. kInitialDriverDescriptor        EQU        0
  121. kVersionOneDriverDescriptor        EQU        1
  122.  
  123. kTheDescriptionSignature        EQU        'mtej'
  124. kDriverDescriptionSignature        EQU        'pdes'
  125. DriverDescription        RECORD 0
  126. driverDescSignature         ds.l    1                ; offset: $0 (0)        ;  Signature field of this structure
  127. driverDescVersion         ds.l    1                ; offset: $4 (4)        ;  Version of this data structure
  128. driverType                 ds        DriverType        ; offset: $8 (8)        ;  Type of Driver
  129. driverOSRuntimeInfo         ds        DriverOSRuntime ; offset: $2C (44)        ;  OS Runtime Requirements of Driver
  130. driverServices             ds        DriverOSService ; offset: $70 (112)        ;  Apple Service API Membership
  131. sizeof                     EQU *                    ; size:   $80 (128)
  132.                         ENDR
  133. ; typedef struct DriverDescription *    DriverDescriptionPtr
  134.  
  135.     ENDIF
  136.     IF FOR_SYSTEM8_PREEMPTIVE THEN
  137. ;
  138. ;################################################
  139. ; Family Matching Data Structure
  140. ;################################################
  141. ;
  142. ;     The Family Type 
  143.  
  144. kFamilyIsHighLevel                EQU        0                    ; High Level Family 
  145. kFamilyIsLowLevel                EQU        1                    ; Low Level Family  
  146. ; typedef UInt32                         FamilyLevel
  147.  
  148. ;  Family Typing Information Used to Match Families With plug-ins and Devices 
  149. FamilyType                RECORD 0
  150. familyLevel                 ds.l    1                ; offset: $0 (0)        ;  Kind of Family 
  151. familyName                 ds.l    1                ; offset: $4 (4)        ;  Family Name 
  152. version                     ds        NumVersion        ; offset: $8 (8)        ;  Family Version Number
  153. reserved                 ds.l    1                ; offset: $C (12)        ;  Used by Mother Board Expert 
  154. sizeof                     EQU *                    ; size:   $10 (16)
  155.                         ENDR
  156. ; typedef struct FamilyType *            FamilyTypePtr
  157.  
  158.  
  159. kFamilyIsLoadedAtBoot            EQU        $00000001            ; Family is loaded at the boot time 
  160. kFamilyIsLoadedUponDiscovery    EQU        $00000002            ; auto-load Family when discovered 
  161. kFamilyIsStartedAtBoot            EQU        $00000004            ; Family is initialized at the Boot 
  162. ; typedef UInt32                         FamilyOSRunTimeOptions
  163.  
  164. FamilyOSRunTime            RECORD 0
  165. familyRuntime             ds.l    1                ; offset: $0 (0)        ;  Options for OS Runtime
  166. familyName                 ds        Str31            ; offset: $4 (4)        ;  Family's name to the OS
  167. familyDescReserved         ds.l    8                ; offset: $24 (36)        ;  Reserved area
  168. sizeof                     EQU *                    ; size:   $44 (68)
  169.                         ENDR
  170. ; typedef struct FamilyOSRunTime *        FamilyOSRunTimePtr
  171.  
  172. ;     The Family Description 
  173.  
  174. kFamilyDescriptionSignature        EQU        'fdes'
  175. ; typedef UInt32                         FamilyDescVersion
  176.  
  177.  
  178. kInitialFamilyDescriptor        EQU        0
  179. kMotherBoardDescriptor            EQU        1
  180. ; typedef UInt32                         DependencyCount
  181.  
  182. MatchingAndDependencyInfo RECORD 0
  183. deviceName                 ds        Str31            ; offset: $0 (0)        ;  the device name to match 
  184.                          ORG 0
  185. dependency                 ds.l    1                ; offset: $0 (0)        ;  Dependency List 
  186.                          ORG 32
  187. sizeof                     EQU *                    ; size:   $20 (32)
  188.                         ENDR
  189. ; typedef struct MatchingAndDependencyInfo * MatchingAndDependencyInfoPtr
  190.  
  191. FamilyMatchingAndDependency RECORD 0
  192. nrElements                 ds.l    1                ; offset: $0 (0)        ;  Number of elements in the Array 
  193. matchingInfo             ds        MatchingAndDependencyInfo ; offset: $4 (4) <-- really an array of length one
  194. sizeof                     EQU *                    ; size:   $24 (36)
  195.                         ENDR
  196. ; typedef struct FamilyMatchingAndDependency * FamilyMatchingAndDependencyPtr
  197.  
  198. FamilyDescription        RECORD 0
  199. familyDescSignature         ds.l    1                ; offset: $0 (0)        ;  Signature field of this structure
  200. familyDescVersion         ds.l    1                ; offset: $4 (4)        ;  Version of this data structure
  201. familyType                 ds        FamilyType        ; offset: $8 (8)        ;  Type of Driver
  202. familyOSRuntime             ds        FamilyOSRunTime ; offset: $18 (24)        ;  OS Runtime Requirements of Family 
  203. familymatchingAndDependency  ds    FamilyMatchingAndDependency ; offset: $5C (92) ;  Family Dependency Info 
  204. sizeof                     EQU *                    ; size:   $80 (128)
  205.                         ENDR
  206. ; typedef struct FamilyDescription *    FamilyDescriptionPtr
  207.  
  208. ;
  209. ;##############################################
  210. ; Definition of "driver-ptr" property
  211. ;##############################################
  212. ;
  213. DriverPtrProperty        RECORD 0
  214. pluginLocator             ds.l    1                ; offset: $0 (0)
  215. length                     ds.l    1                ; offset: $4 (4)
  216. sizeof                     EQU *                    ; size:   $8 (8)
  217.                         ENDR
  218. ; typedef struct DriverPtrProperty *    DriverPtrPropertyPtr
  219.  
  220. ;
  221. ;##############################################
  222. ; Status Definition for DFMReportInitStatus
  223. ;##############################################
  224. ;
  225.  
  226. kInitStatusOK                    EQU        0
  227. kInitStatusNotOK                EQU        1
  228. ;
  229. ;##############################################
  230. ; Declare the pluginLoadID
  231. ;##############################################
  232. ;
  233.  
  234.  
  235. ;
  236. ;##############################################
  237. ; Function Prototypes
  238. ;##############################################
  239. ;
  240. ;
  241. ; extern UInt32 DFMReportInitStatus(OSType serviceCategory, UInt32 status)
  242. ;
  243.     IF GENERATINGCFM THEN
  244.         IMPORT_CFM_FUNCTION DFMReportInitStatus
  245.     ENDIF
  246.  
  247. ;
  248. ; extern OSStatus DFMRemovePlugIns(RegEntryRef *device, OSType serviceCategory, UInt32 nrPlugIns, LogicalAddress *pluginLocatorsInUse)
  249. ;
  250.     IF GENERATINGCFM THEN
  251.         IMPORT_CFM_FUNCTION DFMRemovePlugIns
  252.     ENDIF
  253.  
  254. ;
  255. ; extern OSStatus DFMLoadPlugin(LogicalAddress pluginLocator, ConstStr63Param pluginName, PluginLoadID *pluginLoadID, LogicalAddress *main, LogicalAddress *pluginDT, TextObject optErrMsg)
  256. ;
  257.     IF GENERATINGCFM THEN
  258.         IMPORT_CFM_FUNCTION DFMLoadPlugin
  259.     ENDIF
  260.  
  261. ;
  262. ; extern OSStatus DFMUnloadPlugin(PluginLoadID *pluginLoadID)
  263. ;
  264.     IF GENERATINGCFM THEN
  265.         IMPORT_CFM_FUNCTION DFMUnloadPlugin
  266.     ENDIF
  267.  
  268. ;
  269. ; extern OSStatus DFMGetCFragConnectID(PluginLoadID *pluginLoadID, CFragConnectionID *connectionID)
  270. ;
  271.     IF GENERATINGCFM THEN
  272.         IMPORT_CFM_FUNCTION DFMGetCFragConnectID
  273.     ENDIF
  274.  
  275. ;
  276. ;##############################################
  277. ; Well known properties in the Name Registry
  278. ;##############################################
  279. ;
  280. ;  CPassThru 
  281.     ENDIF
  282.     ENDIF ; __DRIVERFAMILYMATCHING__ 
  283.  
  284.